package xyz.xmh.pattern.behavioral.observerpattern;

/**
 * @author Administrator
 * 观察者的十六进制实现类
 */
public class HexObserver extends AbstractObserver {

    public HexObserver(Subject subject) {
        this.subject = subject;
        this.subject.addObserver(this);
    }

    @Override
    public void update() {
        System.out.println("Hex String: " + Integer.toHexString(subject.getState()).toUpperCase());
    }
}
